True this frame if button b is held down. Add a player number from 1 to 4 to ask another controller: btn_held(BTN_A, 2). Without one it is player 1.
btn_held(b, player = 1) -> bool| Name | Type |
|---|---|
b | button |
player | int (can be left out; then it is 1) |
bool
True this frame if a given button is held down.
True on every frame a button is being held, from the frame it goes down through every frame afterward until it is released - the usual check for something that should keep happening while a button is down, like walking.
Write a player number from 1 to 4 after the button to ask that player's controller: btn_held(BTN_A, 2). Leave it out and it is player 1, the same as writing 1. The number has to be written out in the call (not kept in a variable), and a console that has fewer controllers than that tells you so when you check the game: the Game Boy Advance has one, so only player 1 works there.
if (btn_held(BTN_A)) {
var pressed_a = true;
}Checks the A button's held state every frame and records it in a project-defined pressed_a variable.
The Game Boy Advance has one controller, so only player 1 can be asked here (written out or left out, it is the same call).